<template>
  <div id="app">
    <router-view></router-view>
  </div>
</template>
<script>
  export default ({
    mounted() {
      console.log(window.parent.location.pathname)
      
      if(window.parent.location.pathname.split('/')[1]=="admin"){
        this.$router.replace(window.parent.location.pathname);
        return false;
      }
      
      if (this._isMobile()) {
        // alert("手机端");
        this.$router.replace('/mobile/home');
        return false;
      } else {
        // alert("pc端");
        this.$router.replace('/pc/home');
        return false;
      }
    },
    methods: {

      _isMobile: function () {
        let flag = navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)
        return flag;
      }
    }
  })
</script>
<style>
  @import "./assets/css/color-dark.css";
  /*深色主题*/

  #app {
    overflow-x: hidden;
    background-color: #f5f5f5;
  }
</style>
